package com.xuecheng.content.config;

import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MinIoConfig {

    @Autowired
    private MinioProperties properties;

    @Bean
    public MinioClient minioClient() {
        MinioClient client = MinioClient.builder()
                .credentials(properties.getAccessKey(),properties.getSecretKey()) //用户名密码，
                .endpoint(properties.getEndpoint()) //minio访问地址
                .build();
        return client;
    }
}
